<?php use_stylesheet('terminal.css') ?>
<h2>Liste des TU</h2>

<table>
    <thead>
        <tr>
            <th>Nom TU</th>
            <th>Version (<?= $lastVersion ?>)</th>
            <th>Dernier Envoi</th>
            <th>Maj</th>
            <th>Détail</th>
        </tr>
    </thead>
    <tbody>
	<?php foreach ($tb_tu_list as $i => $tb_tu):
	    $tabCadenas = TuPeer::getIconMaj(($tb_tu->getEtatMaj($lastVersion)));
	    ?>
        <tr class="<?= ($i % 2 == 0 ? "pair" : "impair") ?>">

            <td class="name"><?= $tb_tu->getName() ?></td>
            <td class="vers"><?= $tb_tu->getVersion() ?></td>
            <td class="update">
		    <?php if (!$tb_tu->lastUpdate()):?>
                <img src="<?= ICON_WARNING ?>" alt="Attention" />
		    <?php endif; ?>
		    <?= TuPeer::getDateFormate($tb_tu->getDateUpdate()) ?>
            </td>
    
            <td class="maj">
                <img <?php if ($tabCadenas['i'] == 2) echo ' id="askmaj" ' ?>
                    src="<?= $tabCadenas['src'] ?>" alt="<?= $tabCadenas['alt'] ?>"
                    title="<?= $tabCadenas['title'] ?>" name="<?= $tb_tu->getId() ?>"
                    class="<?= $tabCadenas['class'] ?>"
                    />
            </td>
            <td class="id">
                <a href="<?= url_for('terminal/show?id='.$tb_tu->getId()) ?>">
                    <img src="<?= ICON_LOUPE ?>" alt="loupe" title="détail du terminal" />
                </a>
            </td>

        </tr>
	<?php endforeach; ?>
    </tbody>
</table>

